package cn.ad.enumration;

/***
 * 素材审核状态
 * 
 * @author yujuan.zhang
 * @from 2016-07-26
 * @since DSP V1.1
 *
 */
public enum AuditStatus {
	PENDING(0, "待审核"), 
	INPROGRESS(1, "审核中"), 
	SUCCESS(2, "审核通过"), 
	FAILURE(-1, "审核失败");

	private int value;
	private String description;

	private AuditStatus(int value, String description) {
		this.value = value;
		this.description = description;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	private static java.util.HashMap<Integer, String> mappings;

	private synchronized static java.util.HashMap<Integer, String> getMappings() {
		if (mappings == null) {
			mappings = new java.util.HashMap<Integer, String>();
			for (AuditStatus status : AuditStatus.values()) {
				mappings.put(status.value, status.description);
			}
		}
		return mappings;
	}
	
	public static String forValue(int value) {
		return getMappings().get(value);
	}
}
